package com.android.lyricshow.service;

import java.io.Serializable;

public class Sentence implements Serializable{

	/**
	 * UID
	 */
	private static final long serialVersionUID = 5104881778551564800L;
	/**
	 * the start time
	 */
	private long mFromTime;
	/**
	 * the end time
	 */
	private long mToTime;
	/**
	 * sentence string
	 */
	private String mContent;
	
	public Sentence(String content, long fromTime, long toTime) {
		this.mContent	= content;
		this.mFromTime	= fromTime;
		this.mToTime 	= toTime;
	}

	public Sentence(String content, long fromTime) {
		this(content, fromTime, 0);
	}

	public Sentence(String content) {
		this(content, 0, 0);
	}
	
	public long getFromTime() {
		return mFromTime;
	}

	public void setFromTime(long fromTime) {
		this.mFromTime = fromTime;
	}

	public long getToTime() {
		return mToTime;
	}

	public void setToTime(long toTime) {
		this.mToTime = toTime;
	}
	
	public boolean isInTime(long time) {
		return time >= mFromTime && time <= mToTime;
	}
	
	public long getDuring() {
		return mToTime - mFromTime;
	}
	
	public String getContent(){
		return mContent;
	}
	
	public String toString() {
		return "{" + mFromTime + "(" + mContent + ")" + mToTime + "}";
	}
}
